const imageCdn = 'http://8.137.116.100:3000/files';
const swiperList = [
  `${imageCdn}/凉拌海鲜菇.jpg`,
  `${imageCdn}/平菇炒五花肉.jpg`,
  `${imageCdn}/鸡翅虾滑（可乐）.jpg`
];

// const imageCdn = 'https://tdesign.gtimg.com/mobile/demos';
// const swiperList = [
//   `${imageCdn}/swiper1.png`,
//   `${imageCdn}/swiper2.png`,
//   `${imageCdn}/swiper1.png`,
//   `${imageCdn}/swiper2.png`,
//   `${imageCdn}/swiper1.png`,
// ];

Component({
  data: {
    current: 0,
    autoplay: true,
    duration: 500,
    interval: 3000,
    swiperList,
    ProductData:[
      {
        img:'http://8.137.116.100:3000/files/凉拌海鲜菇.jpg',
        name:'凉拌海鲜菇',
      },
      {
        img:'http://8.137.116.100:3000/files/鸡翅虾滑（可乐）.jpg',
        name:'鸡翅虾滑（可乐）',
      }
    ]
  },

  methods: {
    onTap(e) {
      const { index } = e.detail;

      console.log(index);
    },
    onChange(e) {
      const { current, source } = e.detail;

      // console.log(current, source);
    },
    onImageLoad(e) {
      console.log(e.detail.index);
    },
  },
});
